<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="程月">
    <title>改变图片路径</title>
    <style>
        * {
            box-sizing: border-box;
        }
        div{
            border-radius: 3px;
        }
        main{
            width: 220px;
            height: 280px;
            margin: 0 auto;
            background-color: #aaa;
        }
        section{
            width: 216px;
            height: 276px;
            margin: 5px auto;
            background-color: pink;
        }
        .top{
            display: flex;
            justify-content: space-between;
            margin: 2px;
        }
        .top-left{
            margin: 2px;
        }

        .top-right{
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            margin: 2px;
        }
        ul{
            margin: 0;
            padding: 0;
            list-style: none;
            display: flex;
            flex-wrap: wrap;
        }
        li{
            margin:0 2px;
        }
        img{
            display: inline-block;
            border-radius: 5px;
        }
    </style>
</head>

<body>
    <main>
        <section>
            <div class="top">
                <div class="top-left">
                    <img src="img/big_1.jpg" alt="">
                </div>
                <ul class="top-right">
                       <li><img src="img/small_1.jpg" data-src = "img/big_1.jpg" alt=""></li> 
                       <li><img src="img/small_2.jpg" data-src = "img/big_2.jpg" alt=""></li> 
                       <li><img src="img/small_3.jpg" data-src = "img/big_3.jpg" alt=""></li> 
                </ul>
            </div>
            <div class="bottom">
                <ul>
                    <li><img src="img/small_4.jpg" data-src = "img/big_4.jpg" alt=""></li>
                    <li><img src="img/small_5.jpg" data-src = "img/big_5.jpg" alt=""></li>
                    <li><img src="img/small_6.jpg" data-src = "img/big_6.jpg" alt=""></li>
                    <li><img src="img/small_7.jpg" data-src = "img/big_7.jpg" alt=""></li>
                    <li><img src="img/small_8.jpg" data-src = "img/big_8.jpg" alt=""></li>
                    <li><img src="img/small_9.jpg" data-src = "img/big_9.jpg" alt=""></li>
                    <li><img src="img/small_10.jpg" data-src = "img/big_10.jpg" alt=""></li>
                    <li><img src="img/small_11.jpg" data-src = "img/big_11.jpg" alt=""></li>
                </ul>
            </div>
        </section>
    </main>
</body>

</html>
<script>
    var big = document.querySelector('.top-left img');
    var small = document.querySelectorAll('section li img');

     for(var i = 0;i < small.length;i ++){
         small[i].onmouseover = function () {
         big.src = this.dataset.src;
      }
    }
    
</script>